package com.snow.auth.entity;

import com.snow.jpa.IBaseEntity;
import com.snow.jpa.ITenantEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 用户角色关系表
 *
 * @author by 13119
 */
@Getter
@Setter
@Entity
public class SystemUserRole implements Serializable, IBaseEntity<Integer>, ITenantEntity {
    /**
     * 用户角色对应id
     */
    @Id
    @GeneratedValue(strategy = IDENTITY)
    private Integer id;
    /**
     * 用户id/
     */
    private Integer userId;
    /**
     * 角色id
     */
    private Integer roleId;

    private Integer tenantId;

    public SystemUserRole() {
    }

    public SystemUserRole(Integer userId, Integer roleId, Integer tenantId) {
        this.userId = userId;
        this.roleId = roleId;
        this.tenantId = tenantId;
    }
}
